
#ifndef __CRYPTO_PIPE_BLOCK_H
#define __CRYPTO_PIPE_BLOCK_H

#include <apr_portable.h>
#define RSA_PADDING_SIZE 12

/** An abstract representation of a stream processing 'block', capable
 * of reinterpreting a stream. */
class CryptoPipeBlock
{
   public:
      /** Needs a virtual destructor so that the correct one is called
       * when destroying the abstracted instance. */
      virtual ~CryptoPipeBlock() {}
      /** Process data block and return processed data.
       * 
       * @param inputblock Block buffer data to input.
       * 
       * @param inputsize Size of the block to process.
       * 
       * @param outputsize The size of the output block.
       * 
       * @return A newly allocated block containing the output. */
      virtual char *processDataBlock(const char *inputblock, apr_size_t inputsize, apr_size_t *outputsize) = 0;
      /** Begin processing of the data pipe. */
      virtual int processPipeBegin() = 0;
      /** Step through the processing of the data pipe. */
      virtual int processPipeStep() = 0;
      /** Step through the data, recording data movement.
       * 
       * @param movementin Output the movement into the block into
       * this pointer.
       * 
       * @param movementout Output the movement out of the block into
       * this pointer. */
      virtual int processPipeStep(int *movementin, int *movementout) = 0;
      /** End processing of the data pipe. */
      virtual int processPipeEnd() = 0;
      /** Check security of process. */
      virtual int processWasSecure() = 0;
};

#endif
